
package com.timber.tableModels;

import pv.jfcx.JPVTable;

import com.timber.util.DefaultSLObjectRenderer;
import com.timber.util.SLColumnManager;
import com.timber.util.SLDateRenderer;
import com.timber.util.SLNumberRenderer;



public class InvColumnManager extends SLColumnManager
{
  /**
   **  All the columns known to the inventory application
   **/
//	 tim start
	public static final int ITEM_ID = 1;
	public static final int TIMBER_NAME = 2;
	public static final int TIMBER_CLASS = 3;
	public static final int TIMBER_LENGTH = 4;
	public static final int TIMBER_WIDTH = 5;
	public static final int PURCHASE_QTY= 6;
	public static final int SOLD_QTY= 7;
	public static final int PURCHASE_DATE=8 ;
	public static final int PURCHASE_PRICE=9 ;
	public static final int SOLD_PRICE= 10;
	public static final int SUPPLIER_NAME=11 ;
	public static final int CHILD_COUNT= 12;
	
	// bill panel 
	
	public static final int TAX= 13;
	public static final int TOTAL= 14;
	public static final int AMOUNT= 15;
	// for ITEM Manager
	public static final int LOCATION= 16;
	public static final int LOTNUMBER= 17;
	public static final int MEASURMENT= 18;
	public static final int PURCHASEPRICE= 19;
	public static final int SALESPRICE= 20;
	public static final int PROFITMARGIN= 21;
	public static final int PURCHASEDFROM= 22;
	public static final int COMPANYNAME= 23;
	public static final int PURCHASEDATE= 24;
	public static final int COMMENTS= 25;
	
	// for paymenttable
	public static final int CUSTOMERID= 26;
	public static final int INVOICENUMBER= 27;
	public static final int CUSTOMERNAME= 28;
	public static final int OPENAMOUNT= 29;
	public static final int PAYMENTAMOUNT= 30;
	public static final int PAYMENTDATE= 31;
	public static final int UNITS= 32;
	// tim end 
  

  /**
   **  Singleton instance
   **/
  private static InvColumnManager	icm = new InvColumnManager();

  /**
   **  Returns the singleton instance - creating it if this is the
   **  first call.
   **/
  public static InvColumnManager getInstance()
  {
    if( icm == null )
      icm = new InvColumnManager();

    return icm;
  }

  /**
   **  Private constructor - callers get the singleton instance thru
   **  the getInstance() call.
   **/
  public  InvColumnManager()
  {
    //
    //  Populate our hash tables
    //

    //   ID               IdName                  Display Label              Renderer                                           Width
    //   ---------------- ------------------      --------------------       -------------------                                -----

	  put(ITEM_ID ,"TimberCode", "TimberCode",new DefaultSLObjectRenderer( JPVTable.TEXT_NULL ),null, 9 );
	  put(TIMBER_NAME  ,"TimberName", "TimberName",new DefaultSLObjectRenderer(JPVTable.TEXT_NULL), null, 10);
	  put(TIMBER_CLASS   ,"TClass", "TimberClass",new DefaultSLObjectRenderer(JPVTable.TEXT_NULL), null, 2);
	  put(TIMBER_LENGTH   ,"Lenght", "Length",new SLNumberRenderer(JPVTable.DOUBLE, 10, 4), null, 15);
	  put(TIMBER_WIDTH   ,"Width", "Width",new SLNumberRenderer(JPVTable.DOUBLE, 10, 4), null, 15);		
	  put(PURCHASE_QTY   ,"PQuantity", "Pourchased  Qty",new SLNumberRenderer(JPVTable.DOUBLE, 10, 4), null, 15);
	  put(SOLD_QTY   ,"SQuantity", "Sold Qty",new SLNumberRenderer(JPVTable.DOUBLE, 10, 4), null, 15);
	  put(SOLD_PRICE   ,"SoldPrice", "Sold Price",new SLNumberRenderer(JPVTable.DOUBLE, 10, 4), null, 15);
//	  
	  put(PURCHASE_DATE   ,"PurchaseDate", "Purchase Date",new SLDateRenderer(), null, 10 ) ;	
	  put(PURCHASE_PRICE   ,"PurchaseRate", "Purchase Price",new SLNumberRenderer(JPVTable.DOUBLE, 10, 4), null, 15);
	  put( SUPPLIER_NAME   ,"SupplierId", "Supplier ID",new SLNumberRenderer(JPVTable.DOUBLE, 10, 0), null, 15);
	  put(CHILD_COUNT   ,"ChildId", "No of Pices sold",new SLNumberRenderer(JPVTable.DOUBLE, 10, 0), null, 15);
	  // for Bill Panel
	  put(TAX   ,"tax", "tax",new SLNumberRenderer(JPVTable.DOUBLE, 10, 2), null, 15);
	  put(TOTAL   ,"Total", "Total",new SLNumberRenderer(JPVTable.DOUBLE, 10, 2), null, 15);
	  put(AMOUNT   ,"Amount", "Amount",new SLNumberRenderer(JPVTable.DOUBLE, 10, 2), null, 15);
	  // for Item manger
	  put(LOCATION   ,"Location", "Location",new SLNumberRenderer(JPVTable.TEXT_NULL ), null, 15);
	  put(LOTNUMBER   ,"LotNumber", "LotNumber",new SLNumberRenderer(JPVTable.TEXT_NULL ), null, 15);
	  put(MEASURMENT   ,"Measurment", "Measurment",new SLNumberRenderer(JPVTable.TEXT_NULL), null, 4);
	  put(PURCHASEPRICE   ,"PurChasePrice", "PurChasePrice",new SLNumberRenderer(JPVTable.DOUBLE, 10, 2), null, 15);
	  put(SALESPRICE   ,"SalesPrice", "SalesPrice",new SLNumberRenderer(JPVTable.DOUBLE, 10, 2), null, 15);
	  put(PROFITMARGIN   ,"ProfitMargin", "ProfitMargin",new SLNumberRenderer(JPVTable.DOUBLE, 10, 2), null, 15);
	  put(PURCHASEDFROM   ,"PurchaseFrom", "PurchaseFrom",new SLNumberRenderer(JPVTable.TEXT_NULL ), null, 15);
	  put(PURCHASEDATE   ,"PurchaseDate", "PurchaseDate",new SLNumberRenderer(JPVTable.DATE_PLUS, 10, 2), null, 15);
	  put(COMMENTS   ,"Comments", "Comments",new SLNumberRenderer(JPVTable.TEXT_NULL), null, 15);
	  put(COMPANYNAME   ,"Company", "Company",new SLNumberRenderer(JPVTable.TEXT_NULL), null, 15);
	  put(UNITS   ,"Units", "Units",new SLNumberRenderer(JPVTable.TEXT_NULL), null, 15);
	  
	  // for pyament table
	  put(CUSTOMERNAME   ,"CustomerName", "Customer Name",new SLNumberRenderer(JPVTable.TEXT_NULL), null, 25);
	  put(INVOICENUMBER   ,"InoviceNumber", "Inovice Number",new SLNumberRenderer(JPVTable.TEXT_NULL), null, 15);
	  put(PAYMENTAMOUNT   ,"PaidAmount", "Paid Amount",new SLNumberRenderer(JPVTable.DOUBLE, 10, 2), null, 25);
	  put(PAYMENTDATE   ,"PaidDate", "Paid Date",new SLNumberRenderer(JPVTable.DATE_PLUS, 10, 2), null, 25);
	 

	  
  }
}
